﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.IO;

namespace Planer
{
    static class Program
    {
        /// <summary>
        /// 해당 응용 프로그램의 주 진입점입니다.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Mysql_Planer.My_planer.InOut();
            Application.Run(new Viewplan());

        }
    }
}

namespace Mysql_Planer
{
    class My_planer
    {
        private static string ini_str;
        public static string sql_config;// = "Server=lyn4.iptime.org;Database=planer;Uid=Plan_Master;Pwd=Planer;";
        public static void InOut()
        {
            string readStr = string.Empty;
            string path = Directory.GetCurrentDirectory() + "/Planer.ini";
            FileStream FS = new FileStream(path, FileMode.Open);
            StreamReader Read = new StreamReader(FS);

            while ((readStr = Read.ReadLine()) != null)
            {
                ini_str += readStr + ";";
            }
            sql_config = ini_str;
        }

            //string strConn = My_planer.sql_config;
            //using (MySqlConnection conn = new MySqlConnection(strConn))
            //{
            //    conn.Open();
            //    string sql ="";
            //    MySqlCommand cmd = new MySqlCommand(sql, conn);

            //    cmd.Parameters.Add("@usrid", MySqlDbType.VarChar, 7);
            //    cmd.Parameters[0].Value = usrid;

            //    MySqlDataReader rdr = cmd.ExecuteReader();
            
            //    if(rdr.Read())
            //    {

            //    }
            //    conn.Close();
            //}

    }
}